package com.zhengshang.api.service.impl;

import java.util.List;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppBankMapper;
import com.zhengshang.api.domain.AppBank;
import com.zhengshang.api.service.IAppBankService;

/**
 * 银行Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-06-01
 */
@Service
public class AppBankServiceImpl implements IAppBankService
{
    @Autowired
    private AppBankMapper appBankMapper;

    /**
     * 查询银行
     * 
     * @param bankId 银行ID
     * @return 银行
     */
    @Override
    public AppBank selectAppBankById(Long bankId)
    {
        return appBankMapper.selectAppBankById(bankId);
    }

    @Override
    public String selectAppBankNameById(Long bankId) {
        return appBankMapper.selectAppBankNameById(bankId);
    }

    /**
     * 查询银行列表
     * 
     * @param appBank 银行
     * @return 银行
     */
    @Override
    public List<AppBank> selectAppBankList(AppBank appBank)
    {
        return appBankMapper.selectAppBankList(appBank);
    }

    @Override
    public List<AppBank> queryAppBankList(AppBank appBank) {
        return appBankMapper.queryAppBankList(appBank);
    }

    /**
     * 新增银行
     * 
     * @param appBank 银行
     * @return 结果
     */
    @Override
    public int insertAppBank(AppBank appBank)
    {
        appBank.setCreateTime(DateUtils.getNowDate());
        return appBankMapper.insertAppBank(appBank);
    }

    /**
     * 修改银行
     * 
     * @param appBank 银行
     * @return 结果
     */
    @Override
    public int updateAppBank(AppBank appBank)
    {
        appBank.setUpdateTime(DateUtils.getNowDate());
        return appBankMapper.updateAppBank(appBank);
    }

    /**
     * 批量删除银行
     * 
     * @param bankIds 需要删除的银行ID
     * @return 结果
     */
    @Override
    public int deleteAppBankByIds(Long[] bankIds)
    {
        return appBankMapper.deleteAppBankByIds(bankIds);
    }

    /**
     * 删除银行信息
     * 
     * @param bankId 银行ID
     * @return 结果
     */
    @Override
    public int deleteAppBankById(Long bankId)
    {
        return appBankMapper.deleteAppBankById(bankId);
    }
}
